package com.ztgf.order.api.client;

import com.ztgf.order.models.service.IOrderPayCallBackInfoService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 支付回调信息表控制器
 *
 * @author YUE
 * @Date 2020-11-12 10:12:39
 */

@RestController
@RequestMapping("/api/orderPayCallBackInfo")
@Slf4j
@Api(value = "OrderPayCallBackInfoApiController",tags = "支付回调信息表Api接口")
public class OrderPayCallBackInfoApiController {

    @DubboReference
    private IOrderPayCallBackInfoService orderPayCallBackInfoService;

/*    @PostMapping("/get")
    @ApiOperation(value = "根据id查找",notes = "根据id查找")
    @ApiImplicitParam(name = "id",value = "id",required = true,paramType = "query", dataType = "Long")
    public Result<OrderPayCallBackInfoDTO> get(@RequestParam("id") Long id){
        if(id == null){
            return new Result<>(CodeEnum.FAIL_100002 );
        }

        OrderPayCallBackInfoDTO dto = orderPayCallBackInfoService.selectById(id);

        return new Result<>(dto);
    }

    @ApiOperation(value = "支付回调信息表列表",notes = "支付回调信息表列表")
    @PostMapping("/queryPageList")
    public Result<Page<OrderPayCallBackInfoDTO>> queryPageList(OrderPayCallBackInfoBO bo){
        Wrapper<OrderPayCallBackInfoDTO> wrapper = new EntityWrapper<>();
        if (bo.getStartDate() != null){
            wrapper.ge("create_time", bo.getStartDate());
        }
        if (bo.getEndDate() != null){
            wrapper.le("create_time", bo.getEndDate());

        }
        Page<OrderPayCallBackInfoDTO> page = new Page<>(bo.getPageNo(), bo.getPageSize());
        page = orderPayCallBackInfoService.selectPage(page, wrapper);

        return new Result<>(page);
    }*/
}
